# -*- makefile -*-

LIBUTL/     :=$(realpath $/../libutil/)/
LIBBIO/     :=$(realpath $/../libbio/)/
LIBSEQ/     :=$(realpath $/../libseq/)/
LIBMERYL/   :=$(realpath $/../libmeryl/)/
LIBKMER/    :=$(realpath $/../libkmer/)/

merylsrc := $/args.C \
            $/binaryOp.C \
            $/build.C \
            $/build-threads.C \
            $/dump.C \
            $/estimate.C \
            $/merge.C \
            $/unaryOp.C

#  Removed m.C from SRCS. and m from EXES -- what's it do??

#  meryl.H is exported only for celera-assembler.

$/.CXX_SRCS   := ${merylsrc} $/meryl.C $/mervin.C $/asmMerQC.C $/mapMers.C $/mapMers-depth.C $/maskMers.C $/compare-counts.C $/simple.C
$/.CXX_INCS   := $/meryl.H
$/.CXX_LIBS   := $/libmerylguts.a
$/.CXX_EXES   := $/meryl $/mervin $/simple $/asmMerQC $/mapMers $/mapMers-depth $/testPositionBias $/maskMers $/compare-counts
$/.CLEAN      := $/*.o

$/libmerylguts.a : ${merylsrc:.C=.o}

$/meryl            : $/meryl.o      $/libmerylguts.a            ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a
$/mervin           : $/mervin.o                                 ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a
$/simple           : $/simple.o                                 ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a
$/asmMerQC         : $/asmMerQC.o                               ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a
$/mapMers          : $/mapMers.o           ${LIBKMER/}libkmer.a ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a
$/mapMers-depth    : $/mapMers-depth.o     ${LIBKMER/}libkmer.a ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a
$/m                : $/m.o                 ${LIBKMER/}libkmer.a ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a
$/testPositionBias : $/testPositionBias.o  ${LIBKMER/}libkmer.a ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a
$/maskMers         : $/maskMers.o          ${LIBKMER/}libkmer.a ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a
$/compare-counts   : $/compare-counts.o    ${LIBKMER/}libkmer.a ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a

$(eval $/%.d $/%.o:  CXXFLAGS+=-I${LIBMERYL/} -I${LIBKMER/} -I${LIBBIO/} -I${LIBSEQ/} -I${LIBUTL/})

$/%.d:  ${LIBBIO/}alphabet.h
